
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>短息信息</title>
<jsp:include page="/WEB-INF/backstage/util.jsp" />
<script type="text/javascript">
	function test(obj) {
		if (obj.value == "true ") {
			obj.value = "false";
		} else {
			obj.value = "true";
		}

		var num = document.getElementsByName("num");
		for (var i = 0; i < num.length; i++) {
			num[i].checked = !num[i].checked;
		}
	}
	//发送页面
	$(document)
			.ready(
					function() {
						$("#btn").click(function() {//绑定
							/* alert("ghvvv"); */
							formName.action = "/bsc/Bis_sms_record/list";//跳转
							formName.submit();

						});
						//删除全选和单选
						$("#delBtn")
								.click(
										function(obj) {//绑定
											var array = "";
											var num = document
													.getElementsByName("num");
											for (var i = 0; i < num.length; i++) {
												if (num[i].checked) {
													array += num[i].value + ",";
												}
											}
											if (array.length > 0) {
												array = array.substring(0,
														array.length - 1);
												document.forms[0].action = "/bsc/Bis_sms_record/delete?ids="
														+ array;
												document.forms[0].submit();
											} else {
												alert("你还未选取数据");
											}
										});
					});
	
</script>
</head>
<body>

	<form action="" method="post" id="formName" class="form-inline">
	<label for="opinion_id">收件人:</label><input type="text" name="record_id"id="op">
	 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label for="opinion_id">短信内容:</label><input type="text"name="content" id="op"> 
       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <label for="opinion_id">创建时间:</label><input type="date" name="create_time1" id="op" class="form-control"><label for="opinion_id">至:</label><input type="date"name="create_time2" id="op" class="form-control"><br> 
         <label for="opinion_id">短信类型:</label><select name="sms_type" id="op">
			<option value="">请选择</option>
			<option value="1">普通短信&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
			<option value="2">验证短信&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
			<option value="3">支付短信</option>
		</select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<label for="opinion_id">状态:</label><select name="status" id="op">
			<option value="">请选择&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
			<option value="1">成功</option>
			<option value="0">失败</option>
		</select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		 <label for="opinion_id">发起时间:</label><input type="date"name="send_time1" id="op" class="form-control"><label for="opinion_id">至</label><input type="date"name="send_time2" id="op" class="form-control"> 
		<input type="submit" value="提交"class="btn btn-primary">
		<input type="reset" value="重置" class="btn btn-primary"><br> 
		<input type="button"value="发送短信" id="btn" class="btn btn-primary"/> 
		<input type="button" value="删除" id="delBtn" class="btn btn-primary">
		<!-- 显示 -->
		<table border="1" width="100%" class="table-hover table-condensed table-bordered">
			<tr>
				<td><input type="checkbox" name="" id="" onclick="test(this)" />收件人</td>
				<td>短信内容</td>
				<td>短息类型</td>
				<td>创建时间</td>
				<td>发送时间</td>
				<td>发送状态</td>
				<td>失败原因</td>
			</tr>
			<c:forEach items="${selectBis_sms_record}" var="selectBis_sms_record">
				<tr>
					<td><input type="checkbox" name="num"
						value="${selectBis_sms_record.record_id}" />${selectBis_sms_record.mobile}</td>
					<td>${selectBis_sms_record.content}</td>
					<td><c:if test="${selectBis_sms_record.sms_type=='1'}">普通验证</c:if>
						<c:if test="${selectBis_sms_record.sms_type=='2'}">短信验证</c:if> <c:if
							test="${selectBis_sms_record.sms_type=='3'}">支付验证</c:if> <%--  ${selectBis_sms_record.msg_type=='3'?'支付验证':selectBis_sms_record.msg_type=='2'?'短信验证':'普通验证' }  --%>
					</td>
					<td><fmt:formatDate
							value='${selectBis_sms_record.create_time }' pattern='yyyy-MM-dd' />
					</td>
					<td><fmt:formatDate value='${selectBis_sms_record.send_time}'
							pattern='yyyy-MM-dd' /></td>
					<td><c:if test="${selectBis_sms_record.status=='1'}">成功</c:if>
						<c:if test="${selectBis_sms_record.status=='0'}">失败</c:if></td>
					<td>${selectBis_sms_record.failure_cause}</td>
				</tr>
			</c:forEach>
		</table>
一共1页,3条,当前在0,每页显示:5,当前页3
	<a href="#" onclick="upPage1()">上一页</a>
	<a href="#" onclick="nextPage1()">下一页</a>
	<a href="#" onclick="firstPage1()">首页</a>
	<a href="#" onclick="lastPage1()">尾页</a>
	<input type="text" size="3" name="page" id="page">
	<button type="button" onclick="tiaozhuan()">跳转</button>
	</form>
	<script>
//上一页
function upPage1(){
	pageForm.action="/bsc/Bis_sms_record/selectBis_sms_record?page=0";
	pageForm.submit();
}
//下一页
function nextPage1(){
	pageForm.action="/bsc/Bis_sms_record/selectBis_sms_record?page=1";
	pageForm.submit();
}
//首页
function firstPage1(){
	pageForm.action="/bsc/Bis_sms_record/selectBis_sms_record?page=1";
	pageForm.submit();
}
//尾页
function lastPage1(){
	pageForm.action="/bsc/Bis_sms_record/selectBis_sms_record?page=1";
	pageForm.submit();
}
//跳转
function tiaozhuan(){
	var page=$("#page").val();
	if(page>'1'){
		alert("没有这么多页..");
		return;
	}
	pageForm.action="/bsc/Bis_sms_record/selectBis_sms_record";
	pageForm.submit();
}
</script>
</body>
</html>